import request from '@/utils/request'

// 查询处方单发药明细列表
export function listSend(diagnoseId) {
  return request({
    url: `/order/send/list/${diagnoseId}`,
    method: 'get',
  })
}

// 查询处方单发药明细详细
export function getSend(id) {
  return request({
    url: '/order/send/' + id,
    method: 'get'
  })
}

// 新增处方单发药明细
export function addSend(data) {
  return request({
    url: '/order/send',
    method: 'post',
    data: data
  })
}

// 修改处方单发药明细
export function updateSend(data) {
  return request({
    url: '/order/send',
    method: 'put',
    data: data
  })
}

// 删除处方单发药明细
export function delSend(id) {
  return request({
    url: '/order/send/' + id,
    method: 'delete'
  })
}

// 导出处方单发药明细
export function exportSend(query) {
  return request({
    url: '/order/send/export',
    method: 'get',
    params: query
  })
}

// 保存配药信息
export function batchAdd(data) {
  return request({
    url: '/order/send/batch/add',
    method: 'post',
    data: data
  })
}

// 获取发药仓库列表
export function getDepotList(sendId) {
  return request({
    url: `/order/send/${sendId}/getDepotList`,
    method: 'get'
  })
}

// 发药接口
export function delivery(sendId, data) {
  return request({
    url: `/order/send/${sendId}/delivery`,
    method: 'post',
    data: data
  })
}
